namespace Brjnk.Common
{
    /// <summary>
    /// </summary>
    public class BackgroundOperationState : BackgroundOperationStateBase
    {
        private string info;
        private string longInfo;
        private string infoLocKey;
        private string longInfoLocKey;
        private string name;
        private string nameLocKey;

        private bool isRunning;
        private bool showInList = true;

        public BackgroundOperationState(string name, string nameLocKey, string infoLocKey, string longInfoLocKey, bool showInList)
        {
            this.nameLocKey = nameLocKey;
            this.infoLocKey = infoLocKey;
            this.longInfoLocKey = longInfoLocKey;
            this.name = name;
            this.showInList = showInList;
        }

        public override string Name
        {
            get { return name; }
        }

        public override string Info
        {
            get { return info; }
        }

        public override string LongInfo
        {
            get { return longInfo; }
        }

        public override string NameLocalizationKey
        {
            get { return nameLocKey; }
        }

        public override string InfoLocalizationKey
        {
            get { return infoLocKey; }
        }

        public override string LongInfoLocalizationKey
        {
            get { return longInfoLocKey; }
        }

        public override bool IsRunning
        {
            get { return isRunning; }
        }

        public void SetInfo(string info)
        {
            this.info = info;
            OnPropertyChanged("Info");
        }

        public override bool ShowInList
        {
            get { return showInList; }
        }

        public void SetLongInfo(string info)
        {
            this.longInfo = info;
            OnPropertyChanged("LongInfo");
        }

        public void SetState(bool isRunning)
        {
            if (isRunning != this.isRunning)
            {
                this.isRunning = isRunning;
                OnPropertyChanged("IsRunning");
            }
        }
    }
}